import os
import random
import xml.etree.ElementTree as ET

from utils.utils import get_classes

VOCdevkit_path  = 'niaochao'
if __name__ == "__main__":
    xmlfilepath     = os.path.join(VOCdevkit_path, 'Annotations-all-2432')
    print("xmlfilepath:" + xmlfilepath)
    xmlfiles        = os.listdir(xmlfilepath)

    jpgFilePath     = os.path.join(VOCdevkit_path, 'JPEGImages-all-2432')
    print("jpgFilePath:" + jpgFilePath)
    jpgFiles        = os.listdir(jpgFilePath)

    l = ['a','b','c']
    #删除xml文件
    for filename in xmlfiles:
        if filename[0] in l:
             file = os.path.join(xmlfilepath,filename)
             os.remove(file)
             print(filename+" has be deleted")

    #删除jpg文件
    for filename in jpgFiles:
        if filename[0] in l:
             file = os.path.join(jpgFilePath,filename)
             os.remove(file)
             print(filename+" has be deleted")

        

    